home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / msmtp.postinst < prev    next >
Encoding:
Text File  |  2010-07-22  |  852 b   |  57 lines

  1. #!/bin/sh
  2. set -e
  3.  
  4. if [ -e /usr/share/debconf/confmodule ]; then
  5.     . /usr/share/debconf/confmodule
  6. fi
  7.  
  8.  
  9.  
  10. write_config () {
  11.     exec 1> /etc/msmtprc.new
  12.     echo "account default"
  13.  
  14.     db_get msmtp/host
  15.     if [ "x$RET" != "x" ]; then
  16.         echo "host $RET"
  17.     fi
  18.  
  19.     db_get msmtp/port
  20.     if [ "$RET" != "25" ]; then
  21.         echo "port $RET"
  22.     fi
  23.  
  24.     db_get msmtp/auto_from
  25.     if [ "$RET" = "true" ]; then
  26.         echo "auto_from on"
  27.         db_get msmtp/maildomain
  28.         hostname=`hostname --fqdn`
  29.         echo "maildomain ${RET:-$hostname}"
  30.     fi
  31.  
  32.     db_get msmtp/tls
  33.     if [ "$RET" = "true" ]; then
  34.         echo "tls on"
  35.     fi
  36. }
  37.  
  38. case $1 in
  39.     configure)
  40.         db_get msmtp/sysconfig
  41.         if [ "$RET" = "true" ]; then
  42.             write_config
  43.             if [ -f /etc/msmtprc ]; then
  44.                 ucf --debconf-ok /etc/msmtprc.new /etc/msmtprc
  45.                 rm -f /etc/msmtprc.new
  46.             else
  47.                 mv /etc/msmtprc.new /etc/msmtprc
  48.             fi
  49.         fi
  50.         ;;
  51.     *)
  52.         exit 0
  53.         ;;
  54. esac
  55.  
  56.  
  57.